<template>
	<view>
		<view style="padding:0 20rpx;">
			<u-form-item style="border-bottom: 1rpx solid #EEEEEE;" :label-width="150" label="用户名:"><u-input v-model="name" :border="true" /></u-form-item>
			<u-form-item style="border-bottom: 1rpx solid #EEEEEE;" :label-width="150" label="手机号:"><u-input v-model="name" :border="true" :disabled="true" /></u-form-item>
			<u-form-item style="border-bottom: 1rpx solid #EEEEEE;" :label-width="150" label="姓名:"><u-input v-model="name" :border="true" :disabled="true" /></u-form-item>
			<u-form-item style="border-bottom: 1rpx solid #EEEEEE;" :label-width="150" label="身份证号:"><u-input v-model="name" :border="true" :disabled="true" /></u-form-item>
			<u-form-item style="border-bottom: 1rpx solid #EEEEEE;" :label-width="150" label="实名状态:"><u-input v-model="name" :border="true" :disabled="true" /></u-form-item>
			<view style="margin-top: 20rpx;">
				<text style="font-size: 30rpx; padding: 20rpx">上传头像：</text>
				<u-upload :action="action" @on-success="upucc"></u-upload>
			</view>
		</view>
		<view class="btnSave" @click="btnSave">保存</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
export default {
	data() {
		return {
			name: '',
			action: 'http://47.115.35.16:9001//fileInput/tengxun',
			imgUrl: ''
		};
	},
	methods: {
		btnSave() {
			let data = {
				nickName: this.name,
				avatar: this.imgUrl
			};
			this.$u.api.getmodifyName(data).then(res => {
				this.$refs.uToast.show({
					title: '修改成功',
					type: 'success'
				});
			});
		},
		upucc(d, i, l) {
			let data = JSON.parse(d);
			this.imgUrl = data.path;
		}
	}
};
</script>

<style lang="scss">
.btnSave {
	width: 80%;
	padding: 20rpx;
	background: #05B2B5;
	color: #fff;
	font-size: 30rpx;
	margin: 0 auto;
	text-align: center;
	border-radius: 50rpx;
	margin-top: 50rpx;
}
</style>
